package TankWar;

import java.awt.*;

public class Blood {
    int x,y,w,h;
    TankClient tc;
    int step=0;
    private boolean live=true;

    public void setLive(boolean live) {
        this.live = live;
    }
    public boolean isLive() {
        return live;
    }
    private int [][]pos={{443,43},{293,80},{23,143},{238,243},{213,343},{213,443},{23,543},{233,233}};

    public Blood(){
        x=pos[0][0];
        y=pos[0][1];
        w=h=15;
    }
    public void draw(Graphics g){
        if(!live)return;
        Color c=g.getColor();
        g.setColor(Color.PINK);
        g.fillRect(x,y,w,h);
        g.setColor(c);
        move();
    }

    private void move(){
        step++;
        if(step==pos.length){
            step=0;
        }
        x=pos[step][0];
        y=pos[step][1];
    }
    public Rectangle getRect() {

        return new Rectangle(x,y,w,h);
    }

}
